﻿using DirectSell.Common.Filter;
using DirectSell.Common.Session;
using DirectSell.IBLL;
using DirectSell.Model.User;
using Microsoft.Practices.Unity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;

namespace DirectSell.WebLayer.Areas.User.Controllers
{
    /// <summary>
    /// 修改密码
    /// </summary>
    public class ModifyPasswordController : Controller
    {
        #region 依赖注入--郭文昊--2018年10月31日15:15:04
        [Dependency("UserModifyPassword")]
        public IOperation _modify { get; set; }
        #endregion

        #region 首页
        /// <summary>
        /// 修改密码首页
        /// </summary>
        /// <returns></returns>
        [LoginFilter(IsCheck = true)]
        public ActionResult Index()
        {
            return View();
        }
        #endregion

        #region 修改密码操作
        /// <summary>
        /// 修改密码操作
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task<UserRespCode> ModifyPassword(ModifyPassword model)
        {
            model.UserCode = SessionInfo.GetSession().UserCode;
            return  await _modify.DoOperationAsync(model);
        }
        #endregion

    }
}